<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改状态')"/>
    <th:block th:include="include :: datetimepicker-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-status-edit" th:object="${status}">
        <input name="id" th:field="*{id}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label">波浪艇编号：</label>
            <div class="col-sm-8">
                <input name="boatCode" th:field="*{boatCode}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">纬度：</label>
            <div class="col-sm-8">
                <input name="lng" th:field="*{lng}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">经度：</label>
            <div class="col-sm-8">
                <input name="lat" th:field="*{lat}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">航速：</label>
            <div class="col-sm-8">
                <input name="speed" th:field="*{speed}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">艏向：</label>
            <div class="col-sm-8">
                <input name="heading" th:field="*{heading}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">航向：</label>
            <div class="col-sm-8">
                <input name="course" th:field="*{course}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">舵角：</label>
            <div class="col-sm-8">
                <input name="rudderAngle" th:field="*{rudderAngle}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">俯仰角：</label>
            <div class="col-sm-8">
                <input name="pitch" th:field="*{pitch}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">横滚角：</label>
            <div class="col-sm-8">
                <input name="roll" th:field="*{roll}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">电压01：</label>
            <div class="col-sm-8">
                <input name="voltage1" th:field="*{voltage1}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">电压02：</label>
            <div class="col-sm-8">
                <input name="voltage2" th:field="*{voltage2}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">电压03：</label>
            <div class="col-sm-8">
                <input name="voltage3" th:field="*{voltage3}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">控制模式：</label>
            <div class="col-sm-8">
                <input name="mode" th:field="*{mode}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">8路开关量：</label>
            <div class="col-sm-8">
                <input name="alarm" th:field="*{alarm}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">数据时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="time" th:value="${#dates.format(status.time, 'yyyy-MM-dd')}" class="form-control"
                           placeholder="yyyy-MM-dd" type="text">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript">
    var prefix = ctx + "boat/status";
    $("#form-status-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-status-edit').serialize());
        }
    }

    $("input[name='time']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
</script>
</body>
</html>